<div class="dux-page-header uk-clearfix">
    <div class="page-title">
        <a class="uk-button uk-button-primary" href="{url('index')}"> 订单列表</a>
    </div>
    <div class="page-action">
        <!--if{$status.pay}-->
        <button class="uk-button uk-button-primary"
                data-dux="dialog-open"
                data-url="{url('order/Order/pay', ['order_id' => $info.order_id])}" data-title="确认付款"
                data-height="370px">
            <!--{else}-->
            <button class="uk-button uk-button-primary" disabled>
                <!--{/if}-->
                确认付款
            </button>


            <!--if{$status.parcel}-->
            <button class="uk-button uk-button-primary"
                    data-dux="dialog-open"
                    data-url="{url('order/Order/parcel', ['order_id' => $info.order_id])}" data-title="订单配货"
                    data-height="170px">
                <!--{else}-->
                <button class="uk-button uk-button-primary" disabled>
                    <!--{/if}-->
                    订单配货
                </button>


                <!--if{$status.delivery}-->
                <button class="uk-button uk-button-primary"
                        data-dux="dialog-open"
                        data-url="{url('order/Order/delivery', ['order_id' => $info.order_id])}" data-title="订单发货"
                        data-width="600px"
                        data-height="400px">
                    <!--{else}-->
                    <button class="uk-button uk-button-primary" disabled>
                        <!--{/if}-->
                        订单发货
                    </button>
                    <!--if{$status.complete}-->
                    <button class="uk-button uk-button-primary"
                            data-dux="dialog-open"
                            data-url="{url('order/Order/complete', ['order_id' => $info.order_id])}" data-title="完成订单"
                            data-height="160px">
                        <!--{else}-->
                        <button class="uk-button uk-button-primary" disabled>
                            <!--{/if}-->
                            完成订单
                        </button>
                        <!--if{$status.close}-->
                        <button class="uk-button uk-button-primary"
                                data-dux="dialog-open"
                                data-url="{url('order/Order/close', ['order_id' => $info.order_id])}" data-title="取消订单"
                                data-height="290px">
                            <!--{else}-->
                            <button class="uk-button uk-button-primary" disabled>
                                <!--{/if}-->
                                取消订单
                            </button>
    </div>
</div>
<div class="uk-grid">
    <div class="uk-width-1-3@l uk-width-1-2@m uk-width-1-1@s">
        <div class="uk-card uk-card-small uk-card-default dux-stat-widget">
            <div>
                <i class="media-icon fa fa-btn blue fa fa-money"></i>
                <div class="media-body">
                    <h1 class="title">{$info.total_price}</h1>
                    <p class="grey-text">订单总额</p>
                </div>
            </div>
        </div>
    </div>
    <div class="uk-width-1-3@l uk-width-1-2@m uk-width-1-1@s">
        <div class="uk-card uk-card-small uk-card-default dux-stat-widget">
            <div>
                <i class="media-icon fa fa-btn red fa fa-user"></i>
                <div class="media-body">
                    <h1 class="title">{$info.show_name}</h1>
                    <p class="grey-text">订单用户</p>
                </div>
            </div>
        </div>
    </div>
    <div class="uk-width-1-3@l uk-width-1-2@m uk-width-1-1@s">
        <div class="uk-card uk-card-small uk-card-default dux-stat-widget">
            <div>
                <i class="media-icon fa fa-btn green fa fa-print"></i>
                <div class="media-body">
                    <h1 class="title">{$info.status_data.name}</h1>
                    <p class="grey-text">订单状态</p>
                </div>
            </div>
        </div>

    </div>
</div>

<div class="uk-margin-top">
    <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
        <thead>
        <tr>
            <th colspan="2">商品</th>
            <th>状态</th>
            <th>单价</th>
            <th>优惠</th>
            <th width="150">小计</th>
        </tr>
        </thead>
        <tbody>
        <!--loop{$orderGoods as $vo}-->
        <tr>
            <td width="120">
                <a href="{$vo.goods_url}" target="_blank">
                    <img src="{$vo.goods_image}" alt="" width="80" height="80">
                </a>
            </td>
            <td>
                <a target="_blank" href="{$vo.goods_url}">{$vo.goods_name}</a> x {$vo.goods_qty}
                <div>
                    重量:{$vo.weight/1000}kg
                    <!--if{!empty($vo.goods_options)}-->
                    <!--loop{$vo.goods_options as $v}-->
                    {$v.name}:{$v.value}
                    <!--{/loop}-->
                    <!--{/if}-->
                </div>
            </td>
            <td>
                <!--if{!$vo.service_status}-->
                正常
                <!--{/if}-->
                <!--if{$vo.service_status == 1}-->
                <span class="uk-text-warning">退款/退货中</span>
                <!--{/if}-->
                <!--if{$vo.service_status == 2}-->
                <span class="uk-text-danger">已退款/退货</span>
                <!--{/if}-->
            </td>
            <td>￥{$vo.goods_price}</td>
            <td>￥{$vo.price_discount}</td>
            <td>￥{$vo.price_total}</td>
        </tr>
        <!--{/loop}-->

        </tbody>
    </table>
</div>

<div class="uk-margin-top">
    <div class="uk-grid">
        <div class="uk-width-1-2">
            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th colspan="2">订单信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>订单号: {$info.order_no}</td>
                    <td>买家: <a data-dux="dialog-open"
                               data-url="{url('member/MemberUser/dialogUser', ['id' => $info.order_user_id])}"
                               data-title="用户信息"
                               data-height="250px" href="javascript:;">{$info.show_name}</a></td>
                </tr>
                <tr>

                    <td>付款方式: {$info.pay_type ? '线上支付' : '线下支付'}</td>
                    <td>配送方式: {$info.take_id ? '商品自提' : '快递发货'}</td>
                </tr>
                <tr>

                    <td>下单时间: {date('Y-m-d H:i:s', $info.order_create_time)}</td>
                    <td>付款时间:
                        {$info.pay_time ? date('Y-m-d H:i:s', $info.pay_time) : '未付款'}
                    </td>
                </tr>
                <tr>
                    <td>发货时间:
                        <!--if{$deliveryList}-->
                        {date('Y-m-d H:i:s', $deliveryList[0]['create_time'])}
                        <!--{else}-->
                        未发货
                        <!--{/if}-->
                    </td>
                    <td>完成时间:
                        <!--if{$info.order_complete_time}-->
                        {date('Y-m-d H:i:s', $info.order_complete_time)}
                        <!--{else}-->
                        未完成
                        <!--{/if}-->
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="color:red !important;">
                        订单备注：{$info.order_remark ? $info.order_remark : '无'}
                    </td>
                </tr>
                <!--if{$parcelInfo}-->
                <tr>
                    <td colspan="2">
                        <a href="{url('order/Parcel/printInfo', ['id' => $parcelInfo['parcel_id']])}" target="_blank"
                           class="uk-button uk-button-primary">打印发货单</a>
                    </td>
                </tr>
                <!--{/if}-->
                </tbody>
            </table>

            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th colspan="2">收货信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>收货姓名: {$info.receive_name}</td>
                    <td>收货电话: {$info.receive_tel}</td>
                </tr>
                <tr>
                    <td>邮政编码: {$info.receive_zip ? $info.receive_zip : '无'}</td>
                    <td>收货地区: {$info.receive_province} {$info.receive_city} {$info.receive_region}</td>
                </tr>
                <tr>
                    <td colspan="2">收货地址: {$info.receive_address}</td>
                </tr>
                </tbody>
            </table>

            <!--if{$info.take_id}-->
            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th>商品自提</th>
                </tr>
                </thead>
                <tbody>
                <!--if{!empty($takeInfo)}-->
                <tr>
                    <td>自提点</td>
                    <td>{$takeInfo.name}</td>
                </tr>
                <tr>
                    <td>地址</td>
                    <td>{$takeInfo.province}{$takeInfo.city}{$takeInfo.region}{$takeInfo.address}</td>
                </tr>
                <tr>
                    <td>网点电话</td>
                    <td>{$takeInfo.tel}</td>
                </tr>
                <!--{else}-->
                <tr>
                    <td colspan="4">
                        暂未配货
                    </td>
                </tr>
                <!--{/if}-->
                </tbody>
            </table>
            <!--{else}-->

            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th>快递配送</th>
                </tr>
                </thead>
                <tbody>
                <!--if{!empty($deliveryList)}-->
                <tr>
                    <td>快递名</td>
                    <td>
                        <!--loop{$deliveryList as $vo}-->
                        {$key ? ' | ' : ''}
                        {$vo.delivery_name}
                        <!--{/loop}-->
                    </td>
                </tr>
                <tr>
                    <td>运单号</td>
                    <td>
                        <!--loop{$deliveryList as $key => $vo}-->
                        {$key ? ' | ' : ''}
                        {$vo.delivery_no}
                        <!--{/loop}-->
                    </td>
                </tr>
                <tr>
                    <td>配送时间</td>
                    <td>
                        <!--loop{$deliveryList as $vo}-->
                        {$key ? ' | ' : ''}
                        {date('Y-m-d H:i', $vo.delivery_create_time)}
                        <!--{/loop}-->
                    </td>
                </tr>
                <tr>
                    <td>快递备注</td>
                    <td>
                        <!--loop{$deliveryList as $vo}-->
                        {$key ? ' | ' : ''}
                        {$vo.remark ? $vo.remark : '无'}
                        <!--{/loop}-->
                    </td>
                </tr>
                <!--{else}-->
                <tr>
                    <td colspan="4">
                        暂未配货
                    </td>
                </tr>
                <!--{/if}-->
                </tbody>
            </table>

            <!--{/if}-->

            <!--if{$info.pay_type}-->
            <!--if{!empty($payData)}-->
            <!--loop{$payData as $payInfo}-->

            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th colspan="2">{$payInfo.pay_type}</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>流水号: {$payInfo.log_no}</td>
                    <td>支付时间: {date('Y-m-d H:i:s', $payInfo.time)}</td>
                </tr>
                <tr>
                    <td>支付方式: {$payInfo.pay_name}</td>
                    <td>支付号: {$payInfo.pay_no}</td>
                </tr>
                <tr>
                    <td>支付备注: {$payInfo.remark ? $payInfo.remark : '无'}</td>
                    <td>支付金额: {$payInfo.money}</td>
                </tr>
                </tbody>
            </table>
            <!--{/loop}-->
            <!--{/if}-->
            <!--{else}-->
            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th colspan="2">支付详情</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td colspan="2">货到付款</td>
                </tr>
                </tbody>
            </table>
            <!--{/if}-->

        </div>
        <div class="uk-width-1-2">
            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th colspan="2">支付信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td width="100">付款状态</td>
                    <td>
                        <!--if{$info.pay_status}-->
                        <span class="uk-text-success">已付款</span>
                        <!--{else}-->
                        <span class="uk-text-danger">未付款</span>
                        <!--{/if}-->

                    </td>
                </tr>
                <tr>
                    <td width="100">订单总额</td>
                    <td>￥{$info.order_price}</td>
                </tr>
                <tr>
                    <td>运费</td>
                    <td>￥{$info.delivery_price}</td>
                </tr>
                <tr>
                    <td>优惠</td>
                    <td>￥{$info.pay_discount}</td>
                </tr>
                <!--loop{$info.pay_currency.exchange as $k => $v}-->
                <tr>
                    <td>{$v.name}</td>
                    <td>{$v.money}{$v.unit} 抵 {$v.deduct}元</td>
                </tr>
                <!--{/loop}-->
                <!--loop{$info.pay_currency.append as $k => $v}-->
                <tr>
                    <td>{$v.name}</td>
                    <td>{$v.money} {$v.unit}</td>
                </tr>
                <!--{/loop}-->
                <tr>
                    <td width="100">应付</td>
                    <td>
                        <span class="uk-text-danger">￥{$info.total_price}</span>
                    </td>
                </tr>
                <!--if{bccomp($info.refund_price, 0, 2) === 1}-->
                <tr>
                    <td>退款金额</td>
                    <td>￥{$info.refund_price}</td>
                </tr>
                <!--{/if}-->
                </tbody>
            </table>

            <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table">
                <thead>
                <tr>
                    <th>订单日志</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td style="padding: 0;">
                        <div class="dux-timeline">
                            <!--loop{$logList as $vo}-->
                            <dl>
                                <dt>{date('Y-m-d H:i:s', $vo.time)}</dt>
                                <dd>
                                    {$vo.msg}
                                    <!--if{$vo.remark}-->
                                    <p>{$vo.remark}</p>
                                    <!--{/if}-->
                                </dd>
                            </dl>
                            <!--{/loop}-->
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>